package com.qianfeng.zhangwei.sharepush;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ContentView;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;
import com.qianfeng.zhangwei.sharepush.push.PushActivity;
import com.qianfeng.zhangwei.sharepush.share.ShareActivity;

import cn.sharesdk.framework.ShareSDK;

@ContentView(R.layout.activity_main)
public class MainActivity extends AppCompatActivity {
    @ViewInject(R.id.share_btn)
    Button shareBtn;
    @ViewInject(R.id.push_btn)
    Button pushBtn;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ViewUtils.inject(this);
        ShareSDK.initSDK(getApplicationContext());
    }

    @OnClick({R.id.share_btn, R.id.push_btn})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.share_btn:
                startActivity(new Intent(this, ShareActivity.class));
                break;
            case R.id.push_btn:
                startActivity(new Intent(this, PushActivity.class));
                break;
        }
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
        ShareSDK.stopSDK();
    }
}
